<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class ProjectAuditRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $rules = [
            'project_id'   => 'required|numeric',
            'integrity'    => 'required|numeric|between:22,25',
            'industry'     => 'required|numeric|between:4,5',
            'team'         => 'required|numeric|between:20,40',
            'profit'       => 'required|numeric|between:0,15',
            'wind_control' => 'required|numeric|between:0,15',
        ];

//        return array();

        return $rules;
    }

    public function attributes()
    {
        $attributes = array(
            'integrity'    => '项目完整度',
            'industry'     => '行业评分',
            'team'         => '团队成员评分',
            'profit'       => '盈利模式',
            'wind_control' => '风控',
        );

        return $attributes;
    }

    public function messages()
    {
        $messages = [
            'required' => ':attribute为必填选项',
            'numeric'  => ':attribute必须为数字',
            'between'  => ':attribute必须在:min - :max之间',
        ];

        return $messages;
    }
}
